################################################################################
#
# Build script for WPA Crack Slave and Dummy Master Client
#
################################################################################

# WPA Crack executable (slave)
EXECUTABLE	:= wpa-crack-s
# Cuda source files (compiled with cudacc)
CUFILES		:= gpu-crack-host.cu gpu-crack-device.cu
# C/C++ source files (compiled with gcc / c++)
CCFILES		:= wpa-crack-s.cpp cpu-crack.cpp 
# CUDA file Header Dependencies
CU_DEPS		:=  \
	common.h    \
	cpu-crack.h \
	gpu-crack.h
# C file Header Dependencies
C_DEPS		:=  \
	common.h    \
	cpu-crack.h \
	gpu-crack.h

# C Compiler Flags
WPA_DEBUG := no
ifeq (yes, ${WPA_DEBUG})
  USER_CFLAGS += -g
else
  USER_CFLAGS += -O3
endif

# Do not link with CUTIL
OMIT_CUTIL_LIB := 1

# Verbose 
verbose := 1

################################################################################
# Rules and targets
include ../../common/common.mk

# Extra libs (Should be specified AFTER common.mk)
LIB += -lcrypto -lpthread

# Rules for WPA Crack
all: $(TARGET) dummy-server dummy-master

dummy-server: dummy-server.c
	gcc ${USER_CFLAGS} $^ -o $@

dummy-master: dummy-master.c
	gcc ${USER_CFLAGS} $^ -o $@

user_clean: clean
	rm -rf dummy-master.o dummy-server.o *~ wpa-crack-s dummy-server dummy-master

.PHONY: all clean user_clean
